add Weather tab with minimal, scoped integration#1086
add Weather tab with minimal, scoped integration#1086MaydayV wants to merge 4 commits intoTheBoredTeam:devfrom
Conversation
Alexander5015
left a comment
There was a problem hiding this comment.
The changes seem very disorganized. In order for me to be able to review this properly please esure that:
- All changes for localization keys are in a separate PR. They are not related, and so they shouldn't be in the same PR.
- Code is correctly organized. Right now it seems like the code is isn't in the correct files. Ensure you organize all code into files in a clean way, where all files have proper separation of concerns.
64b76d3 to
26ec366
Compare
- 保留天气功能最小必要改动,移除与功能无关的链式顺序噪音改动。 - 删除 WeatherTabView 中未使用的 hourly UI 路径。 - 删除 WeatherManager 中未使用的小时预报/日出日落数据链路与冗余模型字段。 - 移除 ImageService.swift 中无用导入,并收敛 Tab 标签文本为最小实现。
- remove unused timeZone field from WeatherSnapshot\n- remove unused time fields from current weather decoding models\n- keep weather behavior unchanged while reducing dead code
|
@Alexander5015 Please check my changes to the features and code content again. |
| private var shouldShowWeatherTab: Bool { | ||
| showWeather | ||
| } |
There was a problem hiding this comment.
use showWeather directly rather than this
| return modern | ||
| } | ||
| } catch { | ||
| // fall through to legacy request as compatibility fallback |
There was a problem hiding this comment.
Why is legacy needed as a fallback?
| weatherContentPreference == .currentAndForecast | ||
| } | ||
|
|
||
| var body: some View { |
There was a problem hiding this comment.
break this up, make it a small container with focused subviews
| } | ||
| } | ||
|
|
||
| private func localized(_ key: String, fallback: String) -> String { |
There was a problem hiding this comment.
This might be duplicated in the weather manager
| Text("Show weather") | ||
| } | ||
| if showWeather { | ||
| TextField("City (supports lowercase pinyin)", text: $weatherCity) |
There was a problem hiding this comment.
Support location-based weather as well as manually selecting the city
There was a problem hiding this comment.
I think you should use https://github.com/open-meteo/sdk/tree/main/swift rather than direct API calls
Title
feat(weather): add Weather tab with minimal, scoped integration
Summary
This PR adds a Weather feature to the notch UI with the smallest practical integration scope.
It includes:
Weathertab in the notch UI.WeatherManagerto fetch and manage weather/geocoding data.It does not include localization key changes or unrelated refactors.
Changes
boringNotch/managers/WeatherManager.swiftboringNotch/components/Notch/WeatherTabView.swiftboringNotch/components/Settings/Views/WeatherSettingsView.swiftboringNotch/models/Constants.swiftboringNotch/enums/generic.swiftboringNotch/components/Tabs/TabSelectionView.swiftboringNotch/components/Notch/BoringHeader.swiftboringNotch/ContentView.swiftboringNotch/components/Settings/SettingsView.swiftboringNotch.xcodeproj/project.pbxprojCleanup Included
WeatherManagerto avoid no-op code.Validation
xcodebuild -project boringNotch.xcodeproj -scheme boringNotch -configuration Debug -destination 'platform=macOS' buildNotes